package cate.common.table.item.hero.sheet;


import cate.common.table.ESheet;
import cate.common.table.item.hero.row.HeroLevelRow;
import easy.java.dev.note.NoteClass;

@NoteClass("英雄升级")
public class HeroLevelSheet extends ESheet<HeroLevelRow> {

    @Override
    public String getSheetName() {
        return "升级";
    }

    public HeroLevelRow getByLevel(int level) {
        return get(level);
    }

    public int getMaxLvlByStarAndGrade(int grade, int star) {
        int lvl = 1;
        for (HeroLevelRow row : list) {
            if (row.gradeRequire == grade && row.starRequire == star && row.level > lvl) {
                lvl = row.level;
            }
        }
        return lvl;
    }
}
